dataPath = '../Data/video-processing-basic';
xyloObj = VideoReader(sprintf('%s/C_G_2.mp4',dataPath));

nFrames = xyloObj.NumberOfFrames;
vidHeight = xyloObj.Height;
vidWidth = xyloObj.Width;

%images = read(xyloObj, [620 9701]);
% 
% for i=1:100
% imshow(images(:,:,:,i));
% pause;
% end

%a = images(:,:,:,10);


bxyloObj = VideoReader(sprintf('%s/C_V_1.mp4',dataPath));
bnFrames = bxyloObj.NumberOfFrames;
bvidHeight = bxyloObj.Height;
bvidWidth = bxyloObj.Width;

%bimages = read(bxyloObj, [1 3519]);

%b = bimages(:,:,:,10);

figure;
cnt1 = 620;
cnt2 = 1;
for i=1:3519
    
%     images  = read(xyloObj, [620 9701]);
%     bimages = read(bxyloObj, [1 3519]);
    if ~mod(i,9)
        cnt1 = cnt1+1;       
    elseif ~mod(i,20)
        cnt2 = cnt2+1;
    else
        continue;
    end
    
    images  = read(xyloObj, cnt1);
    bimages = read(bxyloObj, cnt2);
    
%     a =  images(:,:,:,cnt1);
%     b = bimages(:,:,:,cnt2);
    c = [images; bimages];
    imshow(c);
    pause(0.01);
end

% c = [a; b];

% mov(1:nFrames) = ...
%     struct('cdata',zeros(vidHeight,vidWidth,3,'uint8'),...
%     'colormap',[]);
% 
% for k = 1 : nFrames
%     mov(k).cdata = read(xyloObj,k);
% end
% movie(mov,1,xyloObj.FrameRate);